package com.example.p7;

import java.io.File;

public class Main1 {

    public static void main(String[] args) {
        File f = null;
        try {
            f = File.createTempFile("tmp", ".txt", new File("C:/"));
            System.out.println("File path: " + f.getAbsolutePath());
            f.deleteOnExit();
            f = File.createTempFile("tmp", null, new File("D:/"));
            System.out.print("File path: " + f.getAbsolutePath());
            f.deleteOnExit();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}